/*
 * @(#)BannerBOImpl.java $version 2012-8-13
 * 
 * Copyright 2012 NADOSTAR Gruop. All rights Reserved.
 * NADOSTAR PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.nadostar.iims.service.bo.impl;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.nadostar.extensions.util.DataMap;
import com.nadostar.iims.service.bo.BannerBO;
import com.nadostar.iims.service.dao.BannerDAO;

/**
 * The Class BannerBOImpl.
 * 
 * @author Lixing
 *
 */
@Service("BannerBO")
@Transactional(readOnly = true)
public class BannerBOImpl implements BannerBO {
	private static Log log = LogFactory.getLog(BannerBOImpl.class);
	
	@Autowired
	private BannerDAO bannerDAO = null;
	
	public List<DataMap> getBannerList(int bnnrThmSeq, String progress, int offset, int count) {
		List<DataMap> result = new ArrayList<DataMap>();
		try {
			result = bannerDAO.selectBannerList(bnnrThmSeq, progress, offset, count);
		} catch (Exception e) {
			log.error(e, e);
			return new ArrayList<DataMap>();
		}
		return result;
	}

	public int getBannerListCount(int bnnrThmSeq, String progress) {
		try {
			return bannerDAO.selectBannerListCount(bnnrThmSeq, progress);
		} catch (Exception e) {
			log.error(e, e);
			return 0;
		}
	}

	public List<DataMap> getThemaBannerList() {
		List<DataMap> result = new ArrayList<DataMap>();
		try {
			result = bannerDAO.selectThemaBannerList();
		} catch (Exception e) {
			log.error(e, e);
			return new ArrayList<DataMap>();
		}
		return result;
	}

}
